﻿using B.S.BasicData.ErrorCode;
using B.S.BasicData.Write.Application.Common.MenuRole;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.BasicData.Write.Controllers
{
    /// <summary>
    /// Api 控制器-角色菜单管理
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class MenuRoleController : ControllerBase
    {
        private readonly IMediator mediator;

        public MenuRoleController(IMediator mediator)
        {
            this.mediator = mediator;
        }


        /// <summary>
        /// 角色菜单的分配
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<ApiResult<int>> MenuRoleAdd(MeunRoleCommand command)
        { 
            return mediator.Send(command);
        }






    }
}
